package tw.fc.agui;

//[  依Container的規律, 0 在頂層, 隨index漸增而漸深. 後進的在底層.
public class GraphicObjManager extends tw.fc.agui.GrObjManager {
   private static final long serialVersionUID= 2005111614L;

   //[ ---------- construct ----------
   public GraphicObjManager(GrPanel p) { super(p); }
   public GraphicObjManager(GrPanel p, int capacity) { super(p,capacity); }   
   public GraphicObjManager(GraphicObj p) { super(p); }
   public GraphicObjManager(GraphicObj p, int capacity) { super(p,capacity); }   
   //] ---------- construct ----------

   /**
    * 取出 GrObjM中的繪圖物件.
    * @param i 物件編號.
    * @return 指定編號的物件.
    */
   public GraphicObj getObj(int i) {
      return (GraphicObj)super.get(i);
   }

   /**
    * 繪製 GrObjM中的物件.
    * @param g GrCanvas
    */
   public final void paintAllObj(GrCanvas g) {
      //[ 底層先paint
      for(int i=size()-1; i>=0; i--) {
         final GraphicObj ob=this.getObj(i);
         if(ob.visible) {  ob.paintTo(g);  }
      }
   }
}